package com.wanjl.spring_05_mybatis_spring;

import com.wanjl.spring_05_mybatis_spring.common.config.SpringConfig;
import com.wanjl.spring_05_mybatis_spring.entity.Person;
import com.wanjl.spring_05_mybatis_spring.entity.Tea;
import com.wanjl.spring_05_mybatis_spring.service.PersonService;
import com.wanjl.spring_05_mybatis_spring.service.TeaService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @author WanJl
 * @version 1.0
 * @title App
 * @description
 * @create 2024/11/1
 */
public class App {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(SpringConfig.class);
//        TeaService teaService = context.getBean(TeaService.class);
//        List<Tea> teaList = teaService.selectAll();
//        teaList.forEach(System.out::println);
        PersonService personService = context.getBean(PersonService.class);
        List<Person> personList = personService.selectAll();
        personList.forEach(System.out::println);
    }
}
